<?php session_start(); ?>
<img id="captcha" src="captcha/securimage_show.php" alt="CAPTCHA Image" />

<form action="#" method="POST">
<input type="text" name="captcha_code" size="10" maxlength="6" />
<a href="#" onclick="document.getElementById('captcha').src = 'captcha/securimage_show.php?' + Math.random(); return false">[ Different Image ]</a>
    </form>
<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/backbone/captcha/securimage.php';

$securimage = new Securimage();

if ($securimage->check($_POST['captcha_code']) == false) {
    // the code was incorrect
    // you should handle the error so that the form processor doesn't continue

    // or you can use the following code if there is no validation or you do not know how
    echo "The security code entered was incorrect.<br /><br />";
    echo "Please go <a href='javascript:history.go(-1)'>back</a> and try again.";
    exit;
}else{
    echo "You passed";
}

?>